package com.huak.zookeeper.distributedlock.util;

import lombok.extern.slf4j.Slf4j;
import org.apache.curator.framework.CuratorFramework;

/**
 * @author liuhuan
 * @date 2018/11/17 16:58
 * @description
 */
@Slf4j
public class ZkCurator {

    private CuratorFramework client;

    public ZkCurator(CuratorFramework client){
        this.client=client;
    }

    /**
     * 初始化操作
     */
    public void init(){
        client=client.usingNamespace("zk-distributed-lock");

    }

    /**
     * 判断zk是否连接
     * @return
     */
    public boolean isZkAlive(){
        return client.isStarted();
    }


}
